import { post, postFormData } from '../../http'
import store from '@/store'

//新增
export const addDriverModelList=({
  dvrName,
  dvrCtctel,
  dvrLicense,
  dvrVehicleclass,
  dvrIssuingOrg,
  dvrQualiyCer,
  dvrValidpfrom,
  dvrPayway,
  dvrReceiptacco,
  dvrNtvpalce,
  dvrBankcode,
  dvrHvqlfcation,
  dvrDgsqlfcation,
  dvrIdcard,
  dvrHaddress,
  dvrPermanent,
  dvrRemark,
  // dvrLicenurl,//驾驶
  // dvrSfzpositive,//身份证
  // dvrSfzreverse,
  dvrValidpto,
  dvrHead,
  dvrLicenurl,
  dvrSfzpositive,
  dvrSfzreverse,
})=>{
  return post('/FTKJWLHYPT/transoprt/addDriverModelList',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          // dvrLicenurl,
          // dvrSfzpositive,
          // dvrSfzreverse,
          dvrName,
          dvrCtctel,
          dvrLicense,
          dvrVehicleclass,
          dvrIssuingOrg,
          dvrQualiyCer,
          dvrValidpfrom,
          dvrValidpto,
          dvrPayway,
          dvrReceiptacco,
          dvrNtvpalce,
          dvrBankcode,
          dvrHvqlfcation,
          dvrDgsqlfcation,
          dvrIdcard,
          dvrHaddress,
          dvrPermanent,
          dvrRemark,
          dvrHead,
          dvrLicenurl,
          dvrSfzpositive,
          dvrSfzreverse,
          creator:store.state.user.USR_CODE_DX_H,
          fltUuid:store.state.user.FLT_UUID_DX_H,
        }
      }
    }
  })
}

//查询
export const getDriverModelList=({dvrName,dvrAuditStatus,PageIndex,PageSize})=>{
  return post('/FTKJWLHYPT/transoprt/getDriverModelList',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          dvrName,
          PageSize,
          PageIndex,
          dvrAuditStatus,
          fltUuid:store.state.user.FLT_UUID_DX_H,
        }
      },
      Orderby: {},
      PageIndex: {
        FTKJWLHYPT:PageIndex
      },
      PageSize: {
        FTKJWLHYPT:PageSize
      }
    }
  })
}
//查询已审核司机
export const getDriveraisauditList=({dvrName,PageIndexs,PageSizes,isaudit})=>{
  return post('/FTKJWLHYPT/transoprt/getDriverModelList',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          dvrName,
          PageSize,
          PageIndex,
          isaudit,
          fltUuid: store.state.user.FLT_UUID_DX_H,
        }
      },
      Orderby: {},
      PageIndex: {
        FTKJWLHYPT:PageIndex
      },
      PageSize: {
        FTKJWLHYPT:PageSize
      }
    }
  })
}
//编辑
export const editDriverModelList=({
  uuid,
  version,
  dvrPass,
  dvrName,
  dvrCtctel,
  dvrLicense,
  dvrVehicleclass,
  dvrIssuingOrg,
  dvrQualiyCer,
  dvrValidpfrom,
  dvrValidpto,
  dvrPayway,
  dvrReceiptacco,
  dvrNtvpalce,
  dvrBankcode,
  dvrHvqlfcation,
  dvrDgsqlfcation,
  dvrIdcard,
  dvrHaddress,
  dvrPermanent,
  dvrRemark,
  dvrAuditStatus,
  isaudit,
  dvrHead,
  dvrLicenurl,
  dvrSfzpositive,
  dvrSfzreverse,
})=>{
  return post('/FTKJWLHYPT/transoprt/editDriverModelList',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          uuid,
          version,
          dvrPass,
          dvrName,
          dvrCtctel,
          dvrLicense,
          dvrVehicleclass,
          dvrIssuingOrg,
          dvrQualiyCer,
          dvrValidpfrom,
          dvrValidpto,
          dvrPayway,
          dvrReceiptacco,
          dvrNtvpalce,
          dvrBankcode,
          dvrHvqlfcation,
          dvrDgsqlfcation,
          dvrIdcard,
          dvrHaddress,
          dvrPermanent,
          dvrRemark,
          isaudit,
          dvrAuditStatus,
          dvrHead,
          dvrLicenurl,
          dvrSfzpositive,
          dvrSfzreverse,
          lastmodifier:store.state.user.USR_CODE_DX_H,
          fltUuid:store.state.user.FLT_UUID_DX_H,
        }
      }
    }
  })
}

//删除
export const delDriverModelList=({uuid})=>{
  return post('/FTKJWLHYPT/transoprt/delDriverModelList',{
    Data: {
      Parameters: {
        FTKJWLHYPT: {
          uuid,
          fltUuid:store.state.user.FLT_UUID_DX_H,
          dvrFltId:store.state.user.FLT_UUID_DX_H,
        }
      }
    }
  })
}

//重置密码
export const resetPass=({uuid})=>{
  return post('/FTKJWLHYPT/transoprt/resetPass',{

    Data: {
      Parameters: {
        FTKJWLHYPT: {
          uuid,
          fltUuid:store.state.user.FLT_UUID_DX_H,
          dvrFltId:store.state.user.FLT_UUID_DX_H,
        }
      }
    }
  })
}

  //司机上传证件
  export const uploadDriverImg=(file,issuse,uuid)=>{
    let formData = new FormData()
    formData.append('file', file)
    formData.append('uuid', uuid)
    formData.append('name', issuse)
    return postFormData('/FTKJWLHYPT/transoprt/uploadImg',formData)
  }
